var zongfen=0;
function orderNumAdd(thisIndex){

zongfen+=1;
 var orderNum=parseInt($("#orderNum"+thisIndex).html());
 orderNum+=1;
 $("#orderNum"+thisIndex).html(orderNum);
var howNum=$("#ownOrderNum"+thisIndex).length;
if(howNum>0){
    $("#gouwunum"+thisIndex).html(orderNum);
     $("#anothergouwaunum"+thisIndex).html(orderNum);
     $("#anotherzongjia"+thisIndex).html(orderNum*parseInt($("#anotherPrice"+thisIndex).html()));
}else{
var html='<tr class="vary" id="ownOrderNum'+thisIndex+'" sigin="'+thisIndex+'">'+
            '<td class="td_frist">'+$("#orderName"+thisIndex).html()+'</td>'+
            '<td align="center" ><span id="gouwuprice">'+$("#orderPrice"+thisIndex).html()+'</span>元</td>'+
            '<td align="center"><span class="number"><a href="###"><img onclick="orderNumRemove('+thisIndex+')" src="images/subtract.png"></a></span> <span id="gouwunum'+thisIndex+'">'+$("#orderNum"+thisIndex).html()+'</span> <span class="number"><a href="###"><img onclick="orderNumAdd('+thisIndex+')"   src="images/add.png"></a></span></td>'+
            '<td align="center" class="td_last">操作</td>'+
          '</tr>';


 var html2= '<tr id="anotherownOrderaNum'+thisIndex+'"  >'+
          '<td width="420">'+$("#orderName"+thisIndex).html()+'</td>'+
          '<td width="70" align="center">￥<span id="anotherPrice'+thisIndex+'">'+$("#orderPrice"+thisIndex).html()+'</span></td>'+
          '<td width="85" align="center"><span id="anothergouwaunum'+thisIndex+'">'+$("#orderNum"+thisIndex).html()+'</span></td>'+
          '<td align="center">￥<span id="anotherzongjia'+thisIndex+'">'+(parseInt($("#orderNum"+thisIndex).html())*parseInt($("#orderPrice"+thisIndex).html()))+'</span></td>'+
        '</tr>';



$("#moreOrder").append(html);
$("#bigorder").append(html2);
}


var lastmoney=parseInt($("#lastprice").html());
lastmoney+=parseInt($("#orderPrice"+thisIndex).html());
$("#lastprice").html(lastmoney);
$("#yingfuprice").html(lastmoney);
$("#jifenmeishi").html(zongfen);
}

function orderNumRemove(thisIndex){

 var orderNum=parseInt($("#orderNum"+thisIndex).html());


 if(orderNum!=0){
 orderNum-=1;
zongfen-=1;
  $("#orderNum"+thisIndex).html(orderNum);
$("#gouwunum"+thisIndex).html(orderNum);
 $("#anothergouwaunum"+thisIndex).html(orderNum);
     $("#anotherzongjia"+thisIndex).html(orderNum*parseInt($("#anotherPrice"+thisIndex).html()));

 if(orderNum==0){
    $("#ownOrderNum"+thisIndex).remove();
     $("#anotherownOrderaNum"+thisIndex).remove();
 }

var lastmoney=parseInt($("#lastprice").html());
lastmoney-=parseInt($("#orderPrice"+thisIndex).html());

$("#lastprice").html(lastmoney);
$("#yingfuprice").html(lastmoney);
$("#jifenmeishi").html(zongfen);
 }

}